package localdatetime01;

import java.time.LocalDateTime;

/*
 * LocalDateTime:
 *   封装是年月日时分秒,毫秒,纳秒
 *    2007-12-03T10:15:30
 *  1.获取功能
 *    static LocalDateTime now()
 *    int getYear()
 *    Month getMonth()
 *    public int getDayOfMonth()
 *    int getHour() 获取小时
 *    int getMinute() 获取分钟
 *   int getSecond() 获取秒
 */
public class LocalDateTimeDemo01 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);               //  2024-04-19T22:52:48.202121800
        System.out.println(now.getYear());     // 2024
        System.out.println(now.getMonth());   // APRIL
        System.out.println(now.getDayOfMonth());  // 19
        System.out.println(now.getHour());       // 22
        System.out.println(now.getMinute());      //52
        System.out.println(now.getSecond());     //48
    }

}
